package com.sbtr.business.feature.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.sbtr.business.feature.entity.FeLine;
import com.sbtr.business.feature.dto.FeLineDto;

import com.sbtr.business.feature.service.FeLineService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sbtr.business.feature.mapper.FeLineMapper;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.AbstractWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sbtr.common.PageDto;
import com.sbtr.util.PageDtoUtils;
import org.springframework.transaction.annotation.Transactional;

/**
 * 算子连接线段字段列表 Service接口实现类
 *
 * @author dgl
 * @since  2023-04-25
 */
@Transactional
@Service
public class FeLineServiceImpl extends ServiceImpl<FeLineMapper,FeLine> implements FeLineService {

    @Autowired
    FeLineMapper feLineMapper;

    @Override
    public PageDto<FeLine> pageList(FeLineDto feLineDto) {

        IPage<FeLine> page = new Page<>();
        page.setSize(feLineDto.getPageSize());
        page.setCurrent(feLineDto.getPage());
        page = feLineMapper.selectPages(page, BeanUtil.beanToMap(feLineDto));
        PageDto<FeLine> r = PageDtoUtils.getPageDtoByIPage(page, FeLine.class);

        return r;
    }
}

